package cn.zero.feign;

import cn.zero.User;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserFeignClientFallbackFactory implements FallbackFactory<UserFeignClient> {

    @Override
    public UserFeignClient create(Throwable throwable) {
        return new UserFeignClient() {
            @Override
            public User getByUserId(Long id) {
                return new User(-1,"出问题了","溜溜球");
            }
        };
    }
}
